#ifndef AMAZE_H
#define AMAZE_H

#define HEIGHT 7
#define WIDTH 7
#define DllExport   __declspec( dllexport )

enum Treasure { Start01, Start02, Start03, Start04, sym01, sym02, sym03, sym04, sym05, sym06, sym07, sym08, sym09, sym10, sym11, sym12, sym13, sym14, sym15, sym16, sym17, sym18, sym19, sym20, sym21, sym22, sym23, sym24, none  };

typedef struct
{
	int up;
	int down;
	int left;
	int right;
	enum Treasure treasure;
	int contains_me;
	int contains_second;
	int contains_third;
	int contains_fourth;
} Card;


void turnCard(Card *);

typedef struct
{
	int card_count;
	int treasure_count;
	enum Treasure *treasure_contains;
	int contains_me;
	int contains_second;
	int contains_third;
	int contains_fourth;
} Cluster;

void initNewCluster(Cluster*);

typedef struct
{
	Cluster *cluster_contains;
	int cluster_count;
	int axis;
	int dir;
	int pos;
	int orientation;
	int winning;
	int goal_x; //needed?
	int goal_y; //needed?
	int closest_x;
	int closest_y;
} Draw;

typedef struct 
{
	int axis;
	int dir;
	int pos;
	int orientation;
	int go_x;
	int go_y;
} ret_Turn;

typedef struct 
{
	Draw* subject;
	int winning;
	int second_treasures;
	int third_treasures;
	int value;
} valuation;

typedef struct
{
	Draw m;
	int go_x;
	int go_y;
} Turn;


Draw* calc_Draw(Card** Board, enum Treasure goal);

// Cluster.add Funktion
void addCardToCluster( Card*, Cluster*);

// inserts Card in Board, Board stays untouched, axis indicates axis in which it is pushed,
// dir indicates direction (positive/negative), pos indicates Position on axis
Card** insert(Card** Board, Card* crd, int axis, int dir, int pos);

extern "C" DllExport ret_Turn* getDraw(Card** Board, Card* crd, int axis_prev, int dir_prev, int pos_prev, Treasure goal);

Draw* evaluateDraws(Draw* Draws, int cnt, enum Treasure goal);

void freeDraws(Draw*, int);



#endif